<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="949.43">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Helvetica}
p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco}
p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; min-height: 14.0px}
span.s1 {font: 18.0px Helvetica}
span.Apple-tab-span {white-space:pre}
</style>
</head>
<body>
<p class="p1"><span class="s1"><b>AtsFreq / AtsAmp<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b></span><b>Use Freq and Amp data from a given partial</b></p>
<p class="p1"><span class="s1"><b>AtsParInfo<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b></span><b>One UGen to return both Amp and Freq info</b></p>
<p class="p2"><br></p>
<p class="p3"><b>AtsFreq.kr(atsbuffer partialNum, filePointer, mul, add);</b></p>
<p class="p2"><br></p>
<p class="p3"><b>- returns frequency information for a given partial</b></p>
<p class="p2"><br></p>
<p class="p3"><b><span class="Apple-tab-span">	</span>partialNumber - </b>the number of the partial to return frequency data for.<span class="Apple-converted-space">  </span>Partial 0 is the first partial.</p>
<p class="p2"><br></p>
<p class="p3"><b>AtsAmp.kr(atsbuffer, partialNum, filePointer, mul, add);</b></p>
<p class="p2"><br></p>
<p class="p3"><b>- returns amplitude information for a given partial</b></p>
<p class="p2"><br></p>
<p class="p3"><b><span class="Apple-tab-span">	</span>partialNumber - </b>the number of the partial to return frequency data for.<span class="Apple-converted-space">  </span>Partial 0 is the first partial.</p>
<p class="p2"><span class="Apple-tab-span">	</span></p>
<p class="p3"><b>AtsParInfo.kr(atsbuffer, partialNum, filePointer, mul, add);</b></p>
<p class="p2"><br></p>
<p class="p3"><b>- returns amplitude and freq information for a given partial</b></p>
<p class="p2"><br></p>
<p class="p3"><b><span class="Apple-tab-span">	</span>partialNumber - </b>the number of the partial to return frequency data for.<span class="Apple-converted-space">  </span>Partial 0 is the first partial.</p>
<p class="p2"><span class="Apple-tab-span">	</span></p>
<p class="p2"><span class="Apple-tab-span">	</span></p>
<p class="p4"><b>Usage</b></p>
<p class="p2"><span class="Apple-tab-span">	</span><span class="Apple-converted-space"> </span></p>
<p class="p3">For resynthesis purposes, an ATS file needs to be loaded into a buffer.<span class="Apple-converted-space">  </span>When loading an ATS file, you need to supply a buffer number to store ATS data in.</p>
<p class="p2"><br></p>
<p class="p5">s.boot;</p>
<p class="p6"><br></p>
<p class="p5">a = AtsFile.new("sounds/a11wlk01.ats").load;</p>
<p class="p2"><br></p>
<p class="p5">( //use freq and amp information for a filter ugen (just the first 30 partials)</p>
<p class="p5">{</p>
<p class="p5"><span class="Apple-tab-span">	</span>var noise, freqs, amps, partials;</p>
<p class="p5"><span class="Apple-tab-span">	</span>partials = Array.series(30, 1, 1);</p>
<p class="p5"><span class="Apple-tab-span">	</span>// outputs an array of 30 freq values;</p>
<p class="p5"><span class="Apple-tab-span">	</span>freqs = AtsFreq.kr(a.bufnum, partials, MouseX.kr(0, 1));</p>
<p class="p5"><span class="Apple-tab-span">	</span>// outputs an array of 30 amp values</p>
<p class="p5"><span class="Apple-tab-span">	</span>amps = AtsAmp.kr(a.bufnum, partials, MouseX.kr(0, 1));</p>
<p class="p5"><span class="Apple-tab-span">	</span>// feed these into a reson filter, mix down to one channel</p>
<p class="p5"><span class="Apple-tab-span">	</span>Mix.ar(Resonz.ar(WhiteNoise.ar(20), freqs, 0.01, amps));</p>
<p class="p5"><span class="Apple-tab-span">	</span>}.play(s);</p>
<p class="p3">);</p>
<p class="p2"><br></p>
<p class="p5">( //use freq and amp information for a filter ugen (just the first 30 partials)</p>
<p class="p5">{</p>
<p class="p5"><span class="Apple-tab-span">	</span>var noise, freqs, amps, freqs1, amps1, partials, out;</p>
<p class="p5"><span class="Apple-tab-span">	</span>partials = Array.series(30, 1, 1);</p>
<p class="p5"><span class="Apple-tab-span">	</span>// outputs an array of 30 freq values;</p>
<p class="p5"><span class="Apple-tab-span">	</span>out = AtsParInfo.kr(a.bufnum, partials, MouseX.kr(0, 1));</p>
<p class="p5"><span class="Apple-tab-span">	</span>// need to flop the array output</p>
<p class="p5"><span class="Apple-tab-span">	</span>#amps, freqs = out.flop;</p>
<p class="p5"><span class="Apple-tab-span">	</span>// outputs an array of 30 amp values</p>
<p class="p5"><span class="Apple-tab-span">	</span>// feed these into a reson filter, mix down to one channel</p>
<p class="p5"><span class="Apple-tab-span">	</span>Mix.ar(Resonz.ar(WhiteNoise.ar(20), freqs, 0.01, amps ));</p>
<p class="p5"><span class="Apple-tab-span">	</span>}.play(s);</p>
<p class="p3">);</p>
</body>
</html>
